package com.aaa.ss.service;

import com.aaa.common.entity.Order;
import com.aaa.ss.config.MyLBRule;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

//name必须和被调用者注册到注册中心的应用名称一致
@FeignClient(name = "OrderService",configuration = MyLBRule.class)
public interface OrderService {

    /**
     * 调用远程订单方法
     * 1.遵循restful风格,请求方式必须和资源方式一致
     * 2.返回值需要和被调用方法返回值一致
     * 3.请求路径，必须和别调用者请求路径一致
     * @return
     */
    @GetMapping("/order/queryAll")
    //@RequestMapping(name = "/order/queryAll",method = RequestMethod.GET)
    List<Order> getAll();
}
